<form name="editForm" class="form-horizontal" ng-init="dvm.init()" ng-submit="dvm.save(editForm.$valid)" novalidate>
  <div class="modal-header">
    <button type="button" class="close" ng-click="dvm.cancel()">&times;</button>
    <h4 class="modal-title" ng-if="dvm.action == 'new'">新建文件</h4>
    <h4 class="modal-title" ng-if="dvm.action == 'rename'">重命名文件</h4>
  </div>
  <div class="modal-body">
    <div class="form-group">
      <label class="col-sm-2 control-label">文件名：</label>
      <div class="col-sm-10">
        <div class="input-group">
          <input type="text" name="filename" class="form-control" ng-model="dvm.filename" required autofocus
              pattern="^[^:\\*\\?&quot;&lt;&gt;\\|/]{1,255}$"
              ng-class="{'invalid': editForm.$submitted && editForm.filename.$invalid}">
          <span class="input-group-btn">
            <combobox style="width:156px" ng-model="dvm.extension" options="dvm.options" required></combobox>
          </span>
        </div>
        <p class="text-danger" ng-show="editForm.$submitted && editForm.filename.$error.required">文件名不能为空</p>
        <p class="text-danger" ng-show="editForm.$submitted && editForm.filename.$error.pattern">文件名格式不正确</p>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <button ng-if="dvm.action == 'new'" type="submit" class="btn btn-primary"
        ng-disabled="editForm.$invalid || dvm.origin == dvm.file">新建</button>
    <button ng-if="dvm.action == 'rename'" type="submit" class="btn btn-primary"
        ng-disabled="editForm.$invalid || dvm.origin == dvm.file">重命名</button>
    <button type="button" class="btn btn-default" ng-click="dvm.cancel()">取消</button>
  </div>
</form>
